package cn.edu.ctbu.studentmanage.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *  针对tb_dept的实体类
 */
//取对象命一般小写
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "tb_dept")
public class Dept {
    /**
     * 序号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer did;
    /**
     * 院系编号
     */
    @NotNull
    @Size(min = 3,max = 10,message="院系编号最少3位")
    private String dno;

    /**
     * 院系名
     */
    @NotNull
    private String dname;

}
